package com.hx.order.mapper;

import com.hx.order.pojo.Item;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface ItemMapper extends Mapper<Item> {
    @Results({
      @Result(property = "orderId",column = "order_id",jdbcType = JdbcType.VARCHAR),
      @Result(property = "drugId",column = "drug_id",jdbcType = JdbcType.VARCHAR)
    })
    @Select("select order_id,drug_id,num,name,price from order_item where order_id=#{orderId}")
    public List<Item> findByOrderId(String orderId);
}
